package com.codefish.service.impl;

import com.codefish.entity.SysPermissionEntity;
import com.codefish.entity.SysPermissionPointEntity;
import com.codefish.mapper.SysPermissionPointDao;
import com.codefish.service.SysPermissionPointService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

/**
 * 功能
 *
 * @author codefish
 * @email cool_fish@aliyun.com
 * @date 2021-04-15 06:13:14
 */
@Service("sysPermissionPointService")
public class SysPermissionPointServiceImpl extends ServiceImpl<SysPermissionPointDao, SysPermissionPointEntity> implements SysPermissionPointService {

    /**
     * 新增功能
     * @param pointEntity
     * @return
     */
    @Transactional(propagation = Propagation.SUPPORTS,rollbackFor = Exception.class)
    @Override
    public int saveOne(SysPermissionPointEntity pointEntity) {
        boolean save = this.save(pointEntity);
        if (save){
            return 1;
        }
        return 0;
    }
}